<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.8/iconfont.css" />
<script type="text/javascript" src="../lib/My97DatePicker/4.8/WdatePicker.js"></script>
<link rel="stylesheet" href="${ctx }/static/jOrgChart/css/jquery.jOrgChart.css"/>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="${ctx }/static/jOrgChart/jquery.jOrgChart.js"></script>
   
<title>团队成员</title>
</head>
<body>
<!-- <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>财务管理<span class="c-gray en">&gt;</span> 提现列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav> -->
<div class="page-container">
	<form action="showStream" method="post" class="form form-horizontal" id="form-strategy-list">
	<input type="hidden"  id="id" name="id" value="${member.id }">
		<div class="text-c" style="display:flex;align-items:center">
			<input type="text" class="input-text" style="width:100px" placeholder="姓名" id="name" name="name" value="${member.name }">
			&nbsp;&nbsp;&nbsp;
			<input type="text" class="input-text" style="width:100px" placeholder="手机号" id="tel" name="tel" value="${member.tel }">
			&nbsp;&nbsp;&nbsp;
			<input type="text" class="input-text" style="width:100px" placeholder="推广人姓名" id="pname" name="pname" value="${member.pname }">	
			&nbsp;&nbsp;&nbsp;
			<input type="text" class="input-text" style="width:100px" placeholder="推广人手机号" id="ptel" name="ptel" value="${member.ptel }">
			&nbsp;&nbsp;&nbsp;
			<div class="text-c"> 时间：
				<input type="text" onfocus="WdatePicker()" id="starttime" name="starttime"  value="${ordermi.starttime }" class="input-text Wdate" style="width:120px;">
				-
				<input type="text" onfocus="WdatePicker()" id="endtime" name="endtime"  value="${ordermi.endtime }" class="input-text Wdate" style="width:120px;">
			</div>	
			<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i>搜索</button>
		</div>
	</form>
	<br/>
	<div id="tab-system" class="HuiTab" style="height: 900px;">
			<div class="tabBar cl">
				<span>列表</span>
				<span>图形</span>
			</div>
			<div class="tabCon" style="height: 800px;">
				<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<span class="r">共有数据：<strong>${fn:length(memberList) }</strong> 条</span> 
	</div>
		
	<table class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			
			<tr class="text-c">
				<th width="40">序号</th>
				<th width="40">姓名</th>
				<th width="40">手机号</th>
				<th width="40">性别</th>
				<th width="40">等级</th>
				<th width="40">推广人姓名</th>
				<th width="40">推广人手机号</th>
				<!-- <th width="40">等级</th> -->
				<th width="40">加入时间</th>
			</tr>
		</thead>
		<tbody>
			<%-- <c:set var="sum" value="0"></c:set> --%>
			<c:forEach var="member" items="${memberList }" varStatus="index">
			<tr class="text-c">
				<td>${index.index+1 }</td>
				<td>${member.name }</td>
				<td>${member.tel }</td>
				<td>
					<c:if test="${member.sex  == 1}">
						男
					</c:if>
					<c:if test="${member.sex  == 2}">
						女
					</c:if>
				</td>
				<td>
					<c:if test="${member.level  == 1}">
						天使合伙人
					</c:if>
					<c:if test="${member.level  == 2}">
						总监
					</c:if>
					<c:if test="${member.level  == 3}">
						名誉总监
					</c:if>
					<c:if test="${member.level  == 4}">
						督导
					</c:if>
					<c:if test="${member.level  == 5}">
						名誉督导
					</c:if>
					<c:if test="${member.level  == 6}">
						董事
					</c:if>
					<c:if test="${member.level  == 7}">
						名誉董事
					</c:if>
				</td>
				<td>${member.pname }</td>
				<td>${member.ptel }</td>
				<td><fmt:formatDate type="both" dateStyle="medium" timeStyle="medium" value="${member.createtime }" /></td>
			</c:forEach>
		</tbody>
	</table>
	
</div>
<div class="tabCon">
<br>
<!--显示架构图-->
<div id='jOrgChart'></div> 
</div>
	
	<%-- <table>
		<tr><td width="50%"></td><td>积分合计：${sum }</td></tr>
	</table> --%>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="../lib/My97DatePicker/4.8/WdatePicker.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript">
$('.table-sort').dataTable({                         
	"aaSorting": [[ 0, "asc" ]],//默认第几个排序
	"searching":false,//搜索输入框显示
	"aoColumnDefs": [
	  {"orderable":false,"aTargets":[2,0]},// 制定列不参与排序
	  {"orderable":false,"aTargets":[2,2]},// 制定列不参与排序
	  {"orderable":false,"aTargets":[2,3]},// 制定列不参与排序
	]
});

$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$.Huitab("#tab-system .tabBar span","#tab-system .tabCon","current","click","0");
});
 $(function(){
        var showlist = $("<ul id='org' style='display:none'></ul>");
        showall(${data}, showlist);
                $("#jOrgChart").append(showlist);
                $("#org").jOrgChart( {
                    chartElement : '#jOrgChart',//指定在某个dom生成jorgchart
                    dragAndDrop : false //设置是否可拖动
                });
                
                
                
                
                
    }); 
/*     $(function(){
        //数据返回
        $.ajax({
            url: "${ctx}/static/jOrgChart/test.json",
            type: 'GET',
            dataType: 'JSON',
            data: {action: 'org_select'},
            success: function(result){
                var showlist = $("<ul id='org' style='display:none'></ul>");
                showall(result.data, showlist);
                $("#jOrgChart").append(showlist);
                $("#org").jOrgChart( {
                    chartElement : '#jOrgChart',//指定在某个dom生成jorgchart
                    dragAndDrop : false //设置是否可拖动
                });

            }
        });
    }); */

    function showall(menu_list, parent) {
        $.each(menu_list, function(index, val) {
            if(val.childrens.length > 0){

                var li = $("<li></li>");
                li.append("<a href='javascript:void(0)' title='姓名："+val.name+"，tel:"+val.tel+"，性别:"+val.sexname+"，等级:"+val.levelname+"，推广人姓名:"+val.pname+"，推广人电话:"+val.ptel+"，加入时间:"+val.timematter+"' >"+val.name+"</a>").append("<ul></ul>").appendTo(parent);
                //递归显示
                showall(val.childrens, $(li).children().eq(1));
            }else{
                $("<li></li>").append("<a href='javascript:void(0)' title='姓名："+val.name+"，tel:"+val.tel+"，性别:"+val.sexname+"，等级:"+val.levelname+"，推广人姓名:"+val.pname+"，推广人电话:"+val.ptel+"，加入时间:"+val.timematter+"' >"+val.name+"</a>").appendTo(parent);
                //$("<li></li>").append("<a href='javascript:void(0)' onclick=getOrgId("+val.id+");>"+val.name+"</a>").appendTo(parent);
            }
        });

    }
</script>
</body>
</html>
